package com.ctakit.kiwi.common.core.bean.selectors;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Map;

/**
 * @author lizhenmin
 */
public abstract class KeyValueMapSelector extends DefaultSelector<Map<String, Object>> {

    @Override
    public Map<String, Object> select(Object item) {
        return doSelect(item);
    }

    protected abstract Map<String, Object> doSelect(Object item);

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE, false);
    }

}
